#pragma once
#include "stdafx.h"

#ifdef PLUGINICPROCSTEPS_EXPORTS
#define PLUGINICPROCSTEPS_API __declspec(dllexport)
#else
#define PLUGINICPROCSTEPS_API __declspec(dllimport)
#endif

#include "IPluginICProcStepsParamDef.h"
#include "procparam.h"

class PLUGINICPROCSTEPS_API ProcParamDef 
{
friend class ImageProcFn;

public:
	static ProcParamDef *CreateProcParamDef(ProcParamDef *paramdef);
	virtual ~ProcParamDef(void);

	virtual int				MXSTDMETHOD GetIndex() { return _index; }								//return value even if it is invalid
	virtual const char *	MXSTDMETHOD GetName() { return _Name.c_str(); }							//return value even if it is invalid
	virtual const char *	MXSTDMETHOD GetDescription() { return _Description.c_str(); }			//return value even if it is invalid
	virtual IPluginICProcStepsParamDef::Direction MXSTDMETHOD GetDirection() { return _Dir; }		//return value even if it is invalid
	virtual bool			MXSTDMETHOD IsValid() = 0;
	virtual	bool			MXSTDMETHOD IsMatch (IPluginICProcStepsParam  *param, IPluginICProcStepsParamDef::Direction dir) = 0;
	virtual IPluginICProcStepsParamDef::TypeP MXSTDMETHOD GetTypeP() = 0;
	virtual const char *	MXSTDMETHOD GetTypeStr() = 0;
	virtual const char *	MXSTDMETHOD GetDefaultValueStr() = 0;
	virtual const char *	MXSTDMETHOD GetString() = 0;

protected:
	ProcParamDef();
	ProcParamDef(int index, const char *Name, const char *Description, IPluginICProcStepsParamDef::Direction dir);

	virtual		bool		SetXml(void *xmlParam) = 0;
	virtual		bool		Validate() = 0;

protected:
	long	_refCnt;
	bool	_error;
#pragma warning(disable:4251)
	std::string _DefaultValue;
	std::string _Definition;
#pragma warning(default:4251)

private:
	int						_index;
	IPluginICProcStepsParamDef::Direction _Dir;
#pragma warning(disable:4251)
	std::string _Name;
	std::string _Description;
#pragma warning(default:4251)
};

//-------------------------------------------------------------------------------------------------
//			E N D   O F   F I L E
//-------------------------------------------------------------------------------------------------
